const checkPermission = {
  install (Vue, options) {
    Vue.directive('checkPermission', {
      inserted (el, binding, vnode) {
        if (vnode.context.$route.meta.access) {
          let permissionList = vnode.context.$route.meta.access
          if (!permissionList.includes(binding.value)) {
            el.remove()
          }
        } else {
          el.remove()
        }
      }
    })
  }
}
export default checkPermission
